package com.yumeko.zkclient;

import org.I0Itec.zkclient.ZkClient;

/**
 * @program: zookeeper
 * @description:
 * @author: Zheng Hao
 * @create: 2020-03-26 13:15
 */
public class CreateSession {
    public static void main(String[] args) {
        /*
        创建⼀个zkClient实例来进⾏连接
        注意：zkClient通过对zookeeperAPI内部包装，将这个异步的会话创建过程同步化了
        */
        ZkClient zkClient = new ZkClient("192.168.106.128:2183", 3000, 5000);
        //获取事件锁
        System.out.println(zkClient.getEventLock());
    }
}
